package Day7;

public abstract class Shape {
    private Point position;
    public Shape(){

    }
    public Shape(Point position){
        this.position=position;
    }
    //声明一个抽象方法计算形状的面积
    public abstract double area();

    //声明一个抽象方法判断一个点是否在形状内部
    public abstract boolean container(Point p);

    public boolean container(int x,int y){
        return container(new Point(x,y));
    }

    public Point getPosition(){
        return position;
    }

    public void setPosition(Point position){
        this.position=position;
    }
}

